﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TSCC.WinControl
{
    public partial class ucLblTxt : ControlMatrix //UserControl
    {
        [Category("TSCC")]
        [Description("設定顯示文字")]
        public string Caption
        { 
            set
            {
                ucLabel1.Caption = value;
            }
            get
            {
                return ucLabel1.Caption;
            }
        }

        [Category("TSCC")]
        [Description("TextBox 是否為Password")]
        public bool TextBoxISPassword
        {
            set
            {
                textBox1.UseSystemPasswordChar = value;
            }
            get
            {
                return textBox1.UseSystemPasswordChar;
            }
        }

        [Category("TSCC")]
        [Description("TextBox 多行輸入")]
        public bool TextBoxMultiLine
        {
            set
            {
                textBox1.Multiline = value;
            }
            get
            {
                return textBox1.Multiline;            
            }
        }

        [Category("TSCC")]
        [Description("取得和設定Textbox.Text")]        
        public string TextBoxText
        {
            set
            {
                textBox1.Text = value;
            }
            get
            {                
                return textBox1.Text;
            }
        }

        [Category("TSCC")]
        [Description("重新設定高度")]
        public int TextBoxHeight
        {
            set
            {
                textBox1.Height = value;
            }
            get
            {
                return textBox1.Height;
            }
        }

        [Category("TSCC")]
        [Description("重新設定可以輸入的長度")]
        public int TextLength
        {
            set
            {
                textBox1.MaxLength = value;
            }
            get
            {
                return textBox1.MaxLength;
            }
        }

       
        public ucLblTxt()
        {
            InitializeComponent();
            accessControl = textBox1;
        }

        private void textBox1_Leave(object sender, EventArgs e)
        {
            this.OnLeave(e);
        }


        private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
           
        }
    }
}
